package demo;

public class Car {
    private String color;
    private String type;
    public Car() {
        this.color = "红色";
        this.type = "轿车";
    }
    public Car(String color, String type) {
        this.color = color;
        this.type = type;
    }
    public String getColor() {
        return color;
    }
    public String getType() {
        return type;
    }
    public static void main(String[] args) {
        Car car1 = new Car();
        Car car2 = new Car("黑色", "轿车");

        System.out.println(car1.getColor());
        System.out.println(car1.getType());
        System.out.println(car2.getColor());
        System.out.println(car2.getType());
    }
}
